ROS (Noetic)service学习中报错yaml.scanner.ScannerError: mapping values are not allowed here解决方法 | 您所在的位置:网站首页 › ros service is not available › ROS (Noetic)service学习中报错yaml.scanner.ScannerError: mapping values are not allowed here解决方法 |
乌龟例程中,调用“/spawn”服务新生成一只乌龟: rosservice call /spawn "x: 8.0 y: 8.0 theta: 0.0 name: 'turtle2'"会报错: raise ScannerError(None, None, yaml.scanner.ScannerError: mapping values are not allowed here in “”, line 1, column 9: x: 8.0 y: 8.0 theta: 0.0 name: ‘turtle2’ 这是因为输入命令的格式不对,正确的输入方式有两种: 输入$ rosservice call /spawn ",在双引号之后按TAB,会自动补全指令,出现x, y, theta, name参数(都为默认值),然后按左右方向键,进行修改,最后回车。输入$ rosservice call /spawn ",在双引号之后直接按回车,会进入到该指令的参数设置,就是在行开头出现 “>” 这个字符,然后键入相应参数名和参数,例如> x: 6.0,> name: 'turtle5',注意最后要再输入一个双引号并回车使命令运行生效。此时,成功生成新的乌龟,并在乌龟功能包终端打印出相应信息。 |
CopyRight 2018-2019 实验室设备网 版权所有 |